//
//  AppDelegate.m
//  DBJ
//
//  Created by 花化华 on 2016/11/12.
//  Copyright © 2016年 itcast. All rights reserved.
//

#import "AppDelegate.h"
#import "DBJUserAccountModel.h"
#import "DBJUserDefaultsTool.h"
#import "ICSDrawerController.h"
#import "DBJTabBarController.h"
#import "DBJLeftBarController.h"
#import <SMS_SDK/SMSSDK.h>

@interface AppDelegate ()

@property(nonatomic,strong)DBJTabBarController *mainController;
@property(nonatomic,strong)ICSDrawerController *ISCDController;
@property(nonatomic,strong)DBJLeftBarController *leftController;

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    _window = [[UIWindow alloc]initWithFrame:DBJScreenBounds];
    self.window.rootViewController = self.ISCDController;
    [_window makeKeyAndVisible];
    
    //配置SMSSDK的appKey
    [SMSSDK registerApp:@"f3fc6baa9ac4" withSecret:@"7f3dedcb36d92deebcb373af921d635a"];
    
    return YES;
}

#pragma mark - 懒加载
- (DBJTabBarController *)mainController{
    if (!_mainController) {
        _mainController = [[DBJTabBarController alloc]init];
    }
    return _mainController;
}

- (ICSDrawerController *)ISCDController{
    
    
    if (!_ISCDController) {
        _ISCDController = [[ICSDrawerController alloc]initWithLeftViewController:self.leftController centerViewController:self.mainController];
    }
    return _ISCDController;
}

- (DBJLeftBarController *)leftController{
    if (!_leftController) {
        _leftController = [[DBJLeftBarController alloc]init];
    }
    return _leftController;
}

@end
